home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 August: Tool Chest / Dev.CD Aug 00 TC Disk 2.toast / pc / sample code / quicktime / codecs / examplecodec / examplecodec.r < prev   
Encoding:
Text File  |  2000-06-23  |  3.4 KB  |  137 lines

  1. /*
  2.     File:        examplecodec.r
  3.  
  4.     Contains:    
  5.  
  6.     Written by:     
  7.  
  8.     Copyright:    Copyright © 1999 by Apple Computer, Inc., All Rights Reserved.
  9.  
  10.                 You may incorporate this Apple sample source code into your program(s) without
  11.                 restriction. This Apple sample source code has been provided "AS IS" and the
  12.                 responsibility for its operation is yours. You are not permitted to redistribute
  13.                 this Apple sample source code as "Apple sample source code" after having made
  14.                 changes. If you're going to re-distribute the source, we require that you make
  15.                 it clear in the source that the code was descended from Apple sample source
  16.                 code, but that you've made changes.
  17.  
  18.     Change History (most recent first):
  19.                 7/29/1999    Karl Groethe    Updated for Metrowerks Codewarror Pro 2.1
  20.                 
  21.  
  22. */
  23.  
  24. #include "Types.r"
  25. #include "ImageCodec.r"
  26.  
  27.  
  28. #define    exampleCodecFormatName            "Example - YUV"
  29.  
  30.  
  31. #define    exampleCodecFormatType    'exmp'
  32.  
  33.  
  34. /*
  35.  
  36.     This structure defines the capabilities of the codec. There will 
  37.     probably be a tool for creating this resource, which measures the performance
  38.     and capabilities of your codec.
  39.     
  40. */
  41. resource 'cdci' (128, "Example CodecInfo",locked) {
  42.     exampleCodecFormatName,                            /* name of the codec TYPE ( data format ) */
  43.     1,                                                /* version */                            
  44.     1,                                                /* revision */    
  45.     'appl',                                            /* who made this codec */
  46.     codecInfoDoes32 + codecInfoDoesSpool,                /* depth and etc. supported directly on decompress */    
  47.     codecInfoDoes32 + codecInfoDoesSpool,                /* depth and etc supported directly on compress */
  48.     codecInfoDepth16,                                /* which data formats do we understand */
  49.     100,                                            /* compress accuracy (0-255) (relative to format) */
  50.     100,                                            /* decompress accuracy (0-255) (relative to format) */
  51.     200,                                            /* millisecs to compress 320x240 image on base Mac */
  52.     200,                                            /* millisecs to decompress 320x240 image on base Mac */
  53.     100,                                            /* compression level (0-255) (relative to format) */
  54.     0,                                
  55.     2,                                                /* minimum height */
  56.     2,                                                /* minimum width */
  57.     0,
  58.     0,
  59.     0
  60. };
  61.  
  62.  
  63.  
  64. resource 'thng' (128,  "Example Compressor",locked) {
  65.     compressorComponentType,
  66.     exampleCodecFormatType,
  67.     'appl',
  68.     codecInfoDoes32,
  69.     0,
  70.     'cdec',
  71.     128,
  72.     'STR ',
  73.     128,
  74.     'STR ',
  75.     129,
  76.     'ICON',
  77.     128
  78. };
  79.  
  80. resource 'thng' (130,  "Example Decompressor",locked) {
  81.     decompressorComponentType,
  82.     exampleCodecFormatType,
  83.     'appl',
  84.     codecInfoDoes32,
  85.     0,
  86.     'cdec',
  87.     128,
  88.     'STR ',
  89.     130,
  90.     'STR ',
  91.     131,
  92.     'ICON',
  93.     130
  94. };
  95.  
  96.  
  97. resource 'ICON' (128, purgeable) {
  98.     $"0003 8000 0004 C000 0004 C000 0004 C000"
  99.     $"0004 C000 0004 C000 0004 C000 0004 C000"
  100.     $"0004 C000 0004 C000 0004 C000 0004 C000"
  101.     $"0004 C000 0004 C000 0004 C000 0004 C000"
  102.     $"0004 C000 0004 C000 0004 C000 0007 C000"
  103.     $"0008 6000 0018 7000 007F FC00 00C0 1E00"
  104.     $"0180 1F00 0100 0F00 0100 0F00 0300 0F80"
  105.     $"0200 0F80 03FF FF80 0C00 0FE0 0FFF FFE0"
  106. };
  107.  
  108. resource 'STR ' (128) {
  109.     "My Example Compressor"
  110. };
  111.  
  112. resource 'STR ' (129) {
  113.     "Compresses (in an exemplar fasion) an image into a YUVish format."
  114. };
  115.  
  116.  
  117. resource 'ICON' (130, purgeable) {
  118.     $"0200 0F80 03FF FF80 0C00 0FE0 0FFF FFE0"
  119.     $"0180 1F00 0100 0F00 0100 0F00 0300 0F80"
  120.     $"0008 6000 0018 7000 007F FC00 00C0 1E00"
  121.     $"0004 C000 0004 C000 0004 C000 0007 C000"
  122.     $"0004 C000 0004 C000 0004 C000 0004 C000"
  123.     $"0004 C000 0004 C000 0004 C000 0004 C000"
  124.     $"0004 C000 0004 C000 0004 C000 0004 C000"
  125.     $"0003 8000 0004 C000 0004 C000 0004 C000"
  126. };
  127.  
  128. resource 'STR ' (130) {
  129.     "My Example Decompressor"
  130. };
  131.  
  132. resource 'STR ' (131) {
  133.     "Decompresses an image conmpressed in YUVish format."
  134. };
  135.  
  136.  
  137.